package com.warm.pump.module.work.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.HashMap;

import com.warm.pump.module.work.dao.gen.WorkItemSubDao;
import com.warm.pump.module.work.bean.po.gen.WorkItemSub;
import com.warm.pump.module.work.service.IWorkItemSubService;
import com.warm.pump.frame.gen.bean.PageBean;



@Service("WorkItemSubService")
public class WorkItemSubServiceImpl implements IWorkItemSubService {
	@Autowired
	private WorkItemSubDao workItemSubDao;

	@Override
	public WorkItemSub queryObject(Long  id){
		return workItemSubDao.selectByPrimaryKey( id);
	}

	public WorkItemSub queryObject(Map<String, Object> map){
		return workItemSubDao.selectByMap( map);
	}
	
	@Override
	public List<WorkItemSub> queryList(Map<String, Object> map){
		return workItemSubDao.getListByMap(map);
	}

    @Override
    public PageBean getPageBeanByMap(Map map,int pageNo,int pageSize) {
		return workItemSubDao.getPageBeanByMap(map, pageNo, pageSize);
    }


	@Override
	public int queryTotal(Map<String, Object> map){
		return workItemSubDao.countTotalByMap(map);
	}
	
	@Override
	public void save(WorkItemSub workItemSub){
		workItemSubDao.insertSelective(workItemSub);
	}
	
	@Override
	public void update(WorkItemSub workItemSub){
		workItemSubDao.updateByPrimaryKeySelective(workItemSub);
	}
	
	@Override
	public void delete(Long  id){
		workItemSubDao.deleteByPrimaryKey(id);
	}

	@Override
	public void delete(Map<String, Object>  map){
	workItemSubDao.deleteByMap(map);
	}
	
	@Override
	public void deleteBatch(Long[]  ids){
		Map<String, Object> map = new HashMap<>();
		map.put("id_in",ids);
		workItemSubDao.deleteByMap(map);
	}
	
}
